From: Ivan Molodetskikh Date: Thu, 3 Feb 2022 19:47:07 +0000 (+0300) Subject: screenshot-ui: Add mode argument to open() X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~530^2^2~49 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b757f165a315b7efa10834acef92d0d1f9cb33b1;p=gnome-shell.git screenshot-ui: Add mode argument to open() In a subsequent commit we will add a function to open the screenshot UI in the screencast mode. This argument will allow us to do that without resorting to accessing private fields from the outside. Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index 3740975b1..eb9d21a5d 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -988,6 +988,11 @@ class UIWindowSelector extends St.Widget { } }); +const UIMode = { + SCREENSHOT: 0, + SCREENCAST: 1, +}; + var ScreenshotUI = GObject.registerClass({ Properties: { 'screencast-in-progress': GObject.ParamSpec.boolean( @@ -1408,13 +1413,15 @@ var ScreenshotUI = GObject.registerClass({ this._screenSelectors[Main.layoutManager.primaryIndex].checked = true; } - async open() { + async open(mode = UIMode.SCREENSHOT) { if (this._openingCoroutineInProgress) return; if (this._screencastInProgress) return; + this._castButton.checked = mode === UIMode.SCREENCAST; + if (!this.visible) { // Screenshot UI is opening from completely closed state // (rather than opening back from in process of closing).